<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./productionReport.xhtml">

            <ui:define name="tabContent">
                <h:form id="inputForm">
                    <p:panel style="width: 300px">
                        Tháng
                        <p:selectOneMenu value="#{mtProductionBean.month}">
                            <f:selectItem itemLabel="01" itemValue="01"/><f:selectItem itemLabel="02" itemValue="02"/>
                            <f:selectItem itemLabel="03" itemValue="03"/><f:selectItem itemLabel="04" itemValue="04"/>
                            <f:selectItem itemLabel="05" itemValue="05"/><f:selectItem itemLabel="06" itemValue="06"/>
                            <f:selectItem itemLabel="07" itemValue="07"/><f:selectItem itemLabel="08" itemValue="08"/>
                            <f:selectItem itemLabel="09" itemValue="09"/><f:selectItem itemLabel="10" itemValue="10"/>
                            <f:selectItem itemLabel="11" itemValue="11"/><f:selectItem itemLabel="12" itemValue="12"/>
                        </p:selectOneMenu>
                        Năm
                        <p:selectOneMenu value="#{mtProductionBean.year}">
                            <f:selectItem itemLabel="2011" itemValue="2011"/>
                            <f:selectItem itemLabel="2012" itemValue="2012"/>
                            <f:selectItem itemLabel="2013" itemValue="2013"/>
                            <f:selectItem itemLabel="2014" itemValue="2014"/>
                            <f:selectItem itemLabel="2015" itemValue="2015"/>
                        </p:selectOneMenu>
                        <br/>
                        Mạng
                        <p:selectManyCheckbox value="#{mtProductionBean.selectedProviders}">
                            <f:selectItem itemLabel="Mobifone" itemValue="smsgate_mobifone6771"/>
                            <f:selectItem itemLabel="Vinaphone" itemValue="smsgate_vinaphone6771"/>
                            <f:selectItem itemLabel="Viettel" itemValue="smsgate_viettel6771"/>
                        </p:selectManyCheckbox>
                        <p:commandButton ajax="false" value="Xem báo cáo" action="#{mtProductionBean.report()}" onclick="processingDialog.show()"/>
                    </p:panel> 
                </h:form>
                <br/>
                <h:form id="tableForm">
                    <table>
                        <tr>
                            <td style="vertical-align: top">
                                <p:dataTable  id="summaryTable" value="#{mtProductionBean.mtSummaryProductions}" var="detailItem" >
                                    <f:facet name="header">
                                        Tổng hợp
                                    </f:facet>
                                    <p:column headerText="Cú pháp" sortBy="#{detailItem.content}">
                                        #{detailItem.content}
                                    </p:column>
                                    <p:column headerText="Sản lượng" sortBy="#{detailItem.count}">
                                        #{detailItem.count}
                                    </p:column>

                                </p:dataTable>
                            </td>
                            <td style="vertical-align: top">
                                <p:dataTable  id="detailTable" value="#{mtProductionBean.mtProductions}" var="detailItem" >
                                    <f:facet name="header">
                                        Chi tiết
                                    </f:facet>
                                    <p:column headerText="Cú pháp" sortBy="#{detailItem.content}">
                                        #{detailItem.content}
                                    </p:column>
                                    <p:column headerText="Sản lượng" sortBy="#{detailItem.count}">
                                        #{detailItem.count}
                                    </p:column>

                                </p:dataTable>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
